{% extends "staff/base.html" %}
{% import 'staff/_formhelpers.html' as forms %}

{% block title %} Edit Extension - {{ current_course.display_name_with_semester }}{% endblock %}

{% block main %}
  <section class="content-header">
      <h1>
        Edit Extension for {{ current_course.display_name_with_semester }}
        <small>{{ current_course.offering }}</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="{{ url_for(".course", cid=current_course.id) }}">
            <i class="fa fa-university"></i> {{ current_course.offering }}
        </a></li>
        <li><a href="{{ url_for('.list_extensions', cid=current_course.id) }}"><i class="fa fa-life-ring"></i>Extensions</a></li>
        <li class="active hidden-xs"><a href="{{ url_for('.edit_extension', cid=current_course.id, ext_id=extension.id) }}"><i class="fa fa-edit"></i>Edit Extension</a></li>
    	</ol>
  </section>

  <section class="content">
  		{% include 'alerts.html' %}
        <div class="box">
          <div class="box-header with-border">
            <h3 class="box-title">Edit Extension</h3>
                <div class="box-tools clearfix">
                </div>
          </div>
          <div class="box-body">
           <p> Extensions allow the student (and their group members) to submit past normal assignment deadlines. </p>

          {% call forms.render_form(form, action_url=url_for('.edit_extension', cid=current_course.id, ext_id=extension.id),
                                    action_text='Edit Extension', class_='form') %}
            {{ forms.render_field(form.assignment_id) }}
            {{ forms.render_field(form.email, placeholder="student@example.com") }}
            {{ forms.render_field(form.expires, placeholder='YYYY-MM-DD hh:mm:ss', class_='form-control datetime-picker') }}
            {{ forms.render_field(form.reason, placeholder="Because ...") }}
            <label class="control-label">Custom Submission Time: </label>
            <p class="help-block">This overrides the submission time of late submissions</p>
            {{ forms.render_radio_field(form.submission_time) }}
            {{ forms.render_field(
              form.custom_submission_time,
              placeholder='YYYY-MM-DD hh:mm:ss',
              class_='form-control datetime-picker',
              label_visible=false) }}

          {% endcall %}
          </div>
          <!-- /.box-body -->
        </div>


  </section>

  <!-- </body> do not close body in template-->
{% endblock %}
